<template>
  <view class="user-info">
    <view class="user-data" v-if="isLogin">
      <view class="u-head">
        <view class="u-h-img">
          <image
            src="https://pic4.zhimg.com/f96ef2415c1f5c879f5a9578fb153c93_is.jpg"
            mode="widthFix"
          />
        </view>
        <view class="u-name">御前带刀侍卫</view>
      </view>
      <view class="u-btn btn">
        <i class="iconfont icon-zuan"></i> 赚云贝
      </view>
    </view>
    <div v-else class="gologin-warp">
      <div>
        手机电脑多端同步,尽享海量高品质音乐
      </div>
      <div class="gologin-btn btn btn-red" @click="goLogin">
        立即登录
      </div>
    </div>
    <IconBar />
  </view>
</template>

<script>
import IconBar from './IconBar'
export default {
  data() {
    return {
      isLogin:false
    }
  },
  components:{IconBar},
  methods: {
    goLogin(){
      console.log('绑定了事件');
      uni.navigateTo({
        url:'/pages/login/login'
      })
    }
  },
};
</script>

<style lang="scss">
.user-info {
  background-color: #151515;
  border-radius: 20rpx 20rpx 0 0;
  // height: 100rpx;
  padding: 30rpx;


  .user-data {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .u-head {
      display: flex;
      align-items: center;
      .u-h-img {
        width: 64rpx;
        image {
          width: 100%;
          border-radius: 50%;
        }
      }
      .u-name {
        color: #d6d6d6;
        margin-left: 20rpx;
      }
    }
    .u-btn {
      height: 52rpx;
      width: 160rpx;
      border: 4rpx solid #1f1f1f;
      border-radius: 26rpx;
      .iconfont{
        color: $mian-color;
        margin-right: 5rpx;
      }
    }
  }
  .gologin-warp{
    text-align: center;
    color: #fdfafe;
    .gologin-btn{
      width: 320rpx;
      height: 72rpx;
      margin: 20rpx auto;
      border-radius: 36rpx;
    }
  }
}
</style>